<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <main>
        dfawf洒洒唐玮同468学加油学习哦朋友，efgs454别耍朋友加油学习！！
    </main>
    <script>
let main= document.querySelector("main");

//断言匹配 (?=) 后面的语句
//   let reg =/(\w+)(\d+)别耍朋友(?=加油)/;   
//   main.innerHTML=main.innerHTML.replace(reg,`$2`);


//前面断言匹配  (?<=)
let name="唐玮520abcd"
 const reg=/(?<=唐玮)\d+/g;
 console.log(name.match(reg));

 //  ?!后面不是xxx   ?<!前面不是xxx
    </script>
</body>
</html>